<?php

namespace App\Http\Resources;

use Illuminate\Database\Eloquent\Model;

use App\Models\Bill as BillDB;
use Illuminate\Http\Resources\Json\Resource;

class Bill extends Resource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {  	   	
        return [
        		'id' =>$this->id, 
        		'consume_category' => BillDB::getLockStateDisplayMap()[$this->consume_category],
        		'consume_amount' =>$this->consume_amount,
        		'operate_by' =>$this->operate_by,
        		'operate_description' =>$this->operate_description,
        		'account_id' =>$this->account_id,
        		'remark' =>$this->remark
        		
        ];
    }
}
